import axios from "@/utils/axios";
export const getAddrList = data => {
  return axios.request({
    url: "front/user/myAddress",
    method: "get"
  });
};

export const addAddr = data => {
  return axios.request({
    url: "front/user/setAddress",
    data,
    method: "post"
  });
};

export const getAddrById = data => {
  return axios.request({
    url: "front/user/getAddress",
    params: data,
    method: "get"
  });
};

export const deleteAddrById = data => {
  return axios.request({
    url: "front/user/delAddress",
    data,
    method: "post"
  });
};

export const getAppInfo = data => {
  return axios.request({
    url: "common/config",
    method: "get"
  });
};

export const getOrderList = data => {
  return axios.request({
    url: "front/order/orderList",
    params: data,
    method: "get"
  });
};

export const getUserBalance = data => {
  return axios.request({
    url: "front/user/center?type=balance",
    method: "get"
  });
};

export const orderComment = data => {
  return axios.request({
    url: "front/order/evaluate",
    data,
    method: "post"
  });
};

export const getOrderCommentDetail = data => {
  return axios.request({
    url: "front/order/evaluate?type=detail",
    data,
    method: "post"
  });
};

export const getUserInfo = data => {
  return axios.request({
    url: "front/user/center?type=info",
    method: "get",
    params:data
  });
};

export const getProfileInfo = data => {
  return axios.request({
    url: "front/user/center",
    method: "get"
  });
};

export const profileEdit = data => {
  return axios.request({
    url: "front/user/profile",
    data,
    method: "post"
  });
};

export const getProfileDetail = data => {
  return axios.request({
    url: "front/user/profile",
    method: "get"
  });
};

export const getFollowList = data => {
  return axios.request({
    url: "front/user/myConcerns",
    params: data,
    method: "get"
  });
};

export const getFanList = data => {
  return axios.request({
    url: "front/user/fans",
    params: data,
    method: "get"
  });
};

export const getUserCoupon = data => {
  return axios.request({
    url: "front/user/myCoupon",
    method: "get"
  });
};

export const getFavoriteList = data => {
  return axios.request({
    url: "front/user/myCollect",
    method: "get"
  });
};

export const orderAfterSale = data => {
  return axios.request({
    url: "front/order/orderAfter",
    data,
    method: "post"
  });
};

export const realNameAuth = data => {
  return axios.request({
    url: "front/user/identity",
    data,
    method: "post"
  });
};

export const getDailyPoint = data => {
  return axios.request({
    url: "front/dynamic/linkDynamic?type=points",
    method: "post",
    data
  });
};

export const getUserPoint = data => {
  return axios.request({
    url: "front/index/points?type=user",
    method: "get"
  });
};

export const getPointList = params => {
  return axios.request({
    url: "front/index/points?type=record",
    method: "get",
    params
  });
};
export const getMyQrcode = () => {
  return axios.request({
    url: 'front/sharePosterList',
    method: 'get'
  })
}